home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / X11 / Xaw / Text.h < prev    next >
C/C++ Source or Header  |  2006-04-12  |  9KB  |  374 lines

  1. /* $Xorg: Text.h,v 1.4 2001/02/09 02:03:46 xorgcvs Exp $ */
  2.  
  3. /***********************************************************
  4.  
  5. Copyright 1987, 1988, 1994, 1998  The Open Group
  6.  
  7. Permission to use, copy, modify, distribute, and sell this software and its
  8. documentation for any purpose is hereby granted without fee, provided that
  9. the above copyright notice appear in all copies and that both that
  10. copyright notice and this permission notice appear in supporting
  11. documentation.
  12.  
  13. The above copyright notice and this permission notice shall be included in
  14. all copies or substantial portions of the Software.
  15.  
  16. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  19. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  20. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  21. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22.  
  23. Except as contained in this notice, the name of The Open Group shall not be
  24. used in advertising or otherwise to promote the sale, use or other dealings
  25. in this Software without prior written authorization from The Open Group.
  26.  
  27.  
  28. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
  29.  
  30.                         All Rights Reserved
  31.  
  32. Permission to use, copy, modify, and distribute this software and its 
  33. documentation for any purpose and without fee is hereby granted, 
  34. provided that the above copyright notice appear in all copies and that
  35. both that copyright notice and this permission notice appear in 
  36. supporting documentation, and that the name of Digital not be
  37. used in advertising or publicity pertaining to distribution of the
  38. software without specific, written prior permission.  
  39.  
  40. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  41. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  42. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  43. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  44. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  45. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  46. SOFTWARE.
  47.  
  48. ******************************************************************/
  49. /* $XFree86: xc/lib/Xaw/Text.h,v 1.14 2001/01/17 19:42:34 dawes Exp $ */
  50.  
  51. #ifndef _XawText_h
  52. #define _XawText_h
  53.  
  54. #include <X11/Xaw/Simple.h>
  55.  
  56. /*
  57.  
  58.  Class:     textWidgetClass
  59.  Class Name:    Text
  60.  Superclass:    Simple
  61.  
  62.  Resources added by the Text widget:
  63.  
  64.  Name             Class         RepType        Default Value
  65.  ----             -----         -------        -------------
  66.  autoFill        AutoFill         Boolean        False
  67.  bottomMargin        Margin         Position        2
  68.  displayPosition    TextPosition     XawTextPosition    0
  69.  insertPosition        TextPosition     XawTextPosition    0
  70.  justify        JustifyMode         JustifyMode    left
  71.  leftColumn        Column         Column        0
  72.  rightColumn        Column         Column        0
  73.  leftMargin        Margin         Position        2
  74.  rightMargin        Margin         Position        4
  75.  positionCallback   Callback         Callback        NULL
  76.  scrollHorizontal   Scroll         Boolean        False
  77.  scrollVertical     Scroll         Boolean        False
  78.  selectTypes        SelectTypes      Pointer            see documentation
  79.  textSink        TextSink         Widget        NULL
  80.  textSource        TextSource         Widget        NULL
  81.  topMargin        Margin         Position        2
  82.  unrealizeCallback  Callback         Callback        NULL
  83.  wrap            Wrap         XawTextWrapMode    XawTextWrapNever
  84.  
  85. */
  86.  
  87. typedef long XawTextPosition;
  88.  
  89. #ifndef notdef
  90. typedef enum {
  91.   XawtextScrollNever,
  92.   XawtextScrollWhenNeeded,
  93.   XawtextScrollAlways
  94. } XawTextScrollMode;
  95.  
  96. typedef enum {
  97.   XawtextResizeNever,
  98.   XawtextResizeWidth,
  99.   XawtextResizeHeight,
  100.   XawtextResizeBoth
  101. } XawTextResizeMode;
  102. #endif
  103.  
  104. typedef enum {
  105.   XawtextWrapNever,
  106.   XawtextWrapLine,
  107.   XawtextWrapWord
  108. } XawTextWrapMode;
  109.  
  110. typedef enum {
  111.   XawsdLeft,
  112.   XawsdRight
  113. } XawTextScanDirection;
  114.  
  115. typedef enum {
  116.   XawtextRead,
  117.   XawtextAppend,
  118.   XawtextEdit
  119. } XawTextEditType;
  120.  
  121. typedef enum {
  122.   XawselectNull,
  123.   XawselectPosition,
  124.   XawselectChar,
  125.   XawselectWord,
  126.   XawselectLine,
  127.   XawselectParagraph,
  128.   XawselectAll,
  129.   XawselectAlphaNumeric
  130. } XawTextSelectType;
  131.  
  132. typedef enum {
  133.     XawjustifyLeft,
  134.     XawjustifyRight,
  135.     XawjustifyCenter,
  136.     XawjustifyFull
  137. } XawTextJustifyMode;
  138.  
  139. typedef struct {
  140.     int  firstPos;
  141.     int  length;
  142.     char *ptr;
  143.     unsigned long format;
  144. } XawTextBlock, *XawTextBlockPtr;
  145.  
  146. #ifndef OLDXAW
  147. typedef struct {
  148.     int line_number;
  149.     int column_number;
  150.     XawTextPosition insert_position;
  151.     XawTextPosition last_position;
  152.     Boolean overwrite_mode;
  153. } XawTextPositionInfo;
  154.  
  155. typedef struct {
  156.     XawTextPosition left, right;
  157.     XawTextBlock *block;
  158. } XawTextPropertyInfo;
  159.  
  160. typedef struct _XawTextAnchor XawTextAnchor;
  161. typedef struct _XawTextEntity XawTextEntity;
  162. typedef struct _XawTextProperty XawTextProperty;
  163. typedef struct _XawTextPropertyList XawTextPropertyList;
  164. #endif
  165.  
  166. #include <X11/Xaw/TextSink.h>
  167. #include <X11/Xaw/TextSrc.h>
  168.  
  169. #define XtEtextScrollNever "never"
  170. #define XtEtextScrollWhenNeeded "whenneeded"
  171. #define XtEtextScrollAlways "always"
  172. #define XtEtextResizeNever "never"
  173. #define XtEtextResizeWidth "width"
  174. #define XtEtextResizeHeight "height"
  175. #define XtEtextResizeBoth "both"
  176.  
  177. #define XtEtextWrapNever    "never"
  178. #define XtEtextWrapLine        "line"
  179. #define XtEtextWrapWord        "word"
  180.  
  181. #define XtNautoFill "autoFill"
  182. #define XtNbottomMargin "bottomMargin"
  183. #define XtNdialogHOffset "dialogHOffset"
  184. #define XtNdialogVOffset "dialogVOffset"
  185. #define XtNdisplayCaret "displayCaret"
  186. #define XtNdisplayPosition "displayPosition"
  187. #define XtNleftMargin "leftMargin"
  188. #define XtNrightMargin "rightMargin"
  189. #define XtNpositionCallback "positionCallback"
  190. #define XtNscrollVertical "scrollVertical"
  191. #define XtNscrollHorizontal "scrollHorizontal"
  192. #define XtNselectTypes "selectTypes"
  193. #define XtNtopMargin "topMargin"
  194. #define XtNwrap "wrap"
  195.  
  196. #define XtCColumn        "Column"
  197. #define XtNleftColumn        "leftColumn"
  198. #define XtNrightColumn        "rightColumn"
  199.  
  200. #define XtCJustifyMode        XtCJustify
  201. #define XtNjustifyMode        XtNjustify
  202. #define XtEtextJustifyLeft    "left"
  203. #define XtEtextJustifyRight    "right"
  204. #define XtEtextJustifyCenter    "center"
  205. #define XtEtextJustifyFull    "full"
  206.  
  207. #define XtCAutoFill "AutoFill"
  208. #define XtCSelectTypes "SelectTypes"
  209. #define XtCWrap "Wrap"
  210. #ifndef notdef
  211. #define XtCScroll        "Scroll"
  212. #endif
  213.  
  214. #ifndef _XtStringDefs_h_
  215. #define XtNinsertPosition "insertPosition"
  216. #ifndef notdef
  217. #define XtNresize "resize"
  218. #define XtCResize "Resize"
  219. #endif
  220. #define XtNselection        "selection"
  221. #endif
  222.  
  223. /* return Error code for XawTextSearch */
  224. #define XawTextSearchError      (-12345L)
  225.  
  226. /* return codes from XawTextReplace */
  227. #define XawReplaceError           -1
  228. #define XawEditDone        0
  229. #define XawEditError        1
  230. #define XawPositionError    2
  231.  
  232. /* XrmQuark is not unsigned long */
  233. #define XawTextFormat(tw,fmt) ((unsigned long)_XawTextFormat(tw) == (fmt))
  234.  
  235. extern unsigned long FMT8BIT;
  236. extern unsigned long XawFmt8Bit;
  237. extern unsigned long XawFmtWide;
  238.  
  239. extern WidgetClass textWidgetClass;
  240.  
  241. typedef struct _TextClassRec *TextWidgetClass;
  242. typedef struct _TextRec      *TextWidget;
  243.  
  244. _XFUNCPROTOBEGIN
  245.  
  246. XrmQuark _XawTextFormat
  247. (
  248.  TextWidget        tw
  249.  );
  250.  
  251. void XawTextDisplay
  252. (
  253.  Widget            w
  254.  );
  255.  
  256. void XawTextEnableRedisplay
  257. (
  258.  Widget            w
  259.  );
  260.  
  261. void XawTextDisableRedisplay
  262. (
  263.  Widget            w
  264.  );
  265.  
  266. void XawTextSetSelectionArray
  267. (
  268.  Widget            w,
  269.  XawTextSelectType    *sarray
  270.  );
  271.  
  272. void XawTextGetSelectionPos
  273. (
  274.  Widget            w,
  275.  XawTextPosition    *begin_return,
  276.  XawTextPosition    *end_return
  277.  );
  278.  
  279. void XawTextSetSource
  280. (
  281.  Widget            w,
  282.  Widget            source,
  283.  XawTextPosition    top
  284.  );
  285.  
  286. int XawTextReplace
  287. (
  288.  Widget            w,
  289.  XawTextPosition    start,
  290.  XawTextPosition    end,
  291.  XawTextBlock        *text
  292.  );
  293.  
  294. XawTextPosition XawTextTopPosition
  295. (
  296.  Widget            w
  297.  );
  298.  
  299. XawTextPosition XawTextLastPosition
  300. (
  301.  Widget            w
  302.  );
  303.  
  304. void XawTextSetInsertionPoint
  305. (
  306.  Widget            w,
  307.  XawTextPosition    position
  308.  );
  309.  
  310. XawTextPosition XawTextGetInsertionPoint
  311. (
  312.  Widget            w
  313.  );
  314.  
  315. void XawTextUnsetSelection
  316. (
  317.  Widget            w
  318.  );
  319.  
  320. void XawTextSetSelection
  321. (
  322.  Widget            w,
  323.  XawTextPosition    left,
  324.  XawTextPosition    right
  325.  );
  326.  
  327. void XawTextInvalidate
  328. (
  329.  Widget            w,
  330.  XawTextPosition    from,
  331.  XawTextPosition    to
  332. );
  333.  
  334. Widget XawTextGetSource
  335. (
  336.  Widget            w
  337.  );
  338.  
  339. Widget XawTextGetSink
  340. (
  341.  Widget            w
  342.  );
  343.  
  344. XawTextPosition XawTextSearch
  345. (
  346.  Widget            w,
  347. #if NeedWidePrototypes
  348.  int            dir,
  349. #else
  350.  XawTextScanDirection    dir,
  351. #endif
  352.  XawTextBlock        *text
  353.  );
  354.  
  355. void XawTextDisplayCaret
  356. (
  357.  Widget            w,
  358. #if NeedWidePrototypes
  359.  int            visible
  360. #else
  361.  Boolean        visible
  362. #endif
  363.  );
  364.  
  365. _XFUNCPROTOEND
  366.  
  367. /*
  368.  * For R3 compatability only
  369.  */
  370. #include <X11/Xaw/AsciiSrc.h>
  371. #include <X11/Xaw/AsciiSink.h>
  372.  
  373. #endif /* _XawText_h */
  374.